/*
 * @Author: zhang zhijiang 2824735304@qq.com
 * @Date: 2024-12-09 21:24:51
 * @LastEditors: zhang zhijiang 2824735304@qq.com
 * @LastEditTime: 2024-12-09 22:15:36
 * @FilePath: /linux/test_12_9/processa.cc
 * @Description: 这是默认设置,请设置`customMade`, 打开koroFileHeader查看配置 进行设置: https://github.com/OBKoro1/koro1FileHeader/wiki/%E9%85%8D%E7%BD%AE
 */
#include"comman.hpp"
int main()
{
    key_t k = getkey();
    cout<<k<<endl;
    int shmid = create(IPC_CREAT | IPC_EXCL | 0666);
    cout<<shmid<<endl;
   char * address = (char *) shmat(shmid,nullptr,0);//建立链接
   while(true)
   {
    cout<<"client say@";
   cout<<address<<endl;
      sleep(1);
   }
//    sleep(10);
    shmdt(address);
    shmctl(shmid,IPC_RMID,nullptr);
}